<?php
	include_once('../../php/include_all.php');
	$ids=$_GET['ids'];
 //jika kode program berhubungan dg klasifikasi & urusan 
/*	if(!is_numeric($idd)) exit();
	$koja = get_data("select kode_klasifikasi from mus_klasifikasi where id_klasifikasi=".$idd);
	$kojap = $koja['kode_klasifikasi'];
	
	
	$dot = array();
	$id = get_data("select kolom as mac from mus_program where id_kla='$idd' order by kolom desc limit 1");
	//$tes = explode('.', @$id['mac']);
	
	$kode_kla = $kojap.".".(@$id['mac'] + 1);
	echo $kode_kla;
*/
	if(is_numeric($ids)){
		$kode = get_data("select * from mus_klasifikasi where id_klasifikasi='$ids'");
		$kd = $kode['kode_klasifikasi'];
		$id = get_data("select count(id_program) as mac from mus_program where id_kla='$ids'");
 
		if($kd == 'xx.xx'){
			//$id = get_data("select count(id_program) as mac from mus_program where id_kla='$ids'");
			$kode_pro =$id['mac']+1;
			$kodepro = ($kode_pro <= 9) ? "0" . $kode_pro:$kode_pro;
			echo $kodepro;
		}
		else {
			$dot = array();
			$kode_pro = $id['mac'] + 15;
			//$kodepro = ($kode_pro <= 9) ? "0" . $kode_pro:$kode_pro;
			echo $kode_pro;
		}
	}
?>